Verifying that DWfile is installed

To access the functions in the DWfile library, the library must be present in the Configuration/JSExtensions folder and loaded by Dreamweaver. Because DWfile did not ship with Dreamweaver 2 (it was available as a separate download that had to be installed by the user), it is useful to verify that the library is available before calling any of its functions. You can do this by checking the typeof(DWfile). If DWfile does not exist, typeof(DWfile) will return undefined. For example, if you are using DWfile in the context of a command, you might check for the existence of DWfile as part of the canAcceptCommand() function:

  // Returns TRUE if typeof(DWfile) is not undefined, FALSE otherwise.
  function canAcceptCommand(){
    return (typeof(DWfile) != "undefined");
  }